Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logger_name option #30

Merged
merged 5 commits into from
Apr 30, 2024
Merged

Add logger_name option #30

merged 5 commits into from
Apr 30, 2024

Conversation

JoeZiminski
Copy link
Member

@JoeZiminski JoeZiminski commented Apr 29, 2024

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed? & What does this PR do?

This PR adds a logger_name variable that lets the logger than fancylog sets up be given a name. This is useful
for grabbing this logger at a later time.

How has this PR been tested?

Added new test to check expected logger_name is created.

Change is not breaking nor requires documentation change.

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

@JoeZiminski JoeZiminski requested a review from adamltyson April 30, 2024 09:07
Copy link
Member

@adamltyson adamltyson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice, thanks @JoeZiminski. I've left one comment. Would you also mind adding it's use to example.py too? That's the closest thing we have to docs currently!

fancylog/fancylog.py Outdated Show resolved Hide resolved
@JoeZiminski
Copy link
Member Author

JoeZiminski commented Apr 30, 2024

Hey @adamltyson sure, I have added it in the example, making it the 'canonical' way to use fancylog. We could also show a version without filename where logging is done as was previously (logging.info("...")) but not sure if this is overkill. But would be happy to add as another function (rename main to example_with_logger_name then create a second example_without_logger_name.

@JoeZiminski
Copy link
Member Author

BTW after this PR could we release as a new version so it will be downloaded from PyPI? Will help with some datashuttle stuff

@adamltyson
Copy link
Member

I think this is fine, I've created #31 to track documenting fancylog properly.

Will release now.

@adamltyson adamltyson merged commit 712ca06 into master Apr 30, 2024
19 checks passed
@adamltyson adamltyson deleted the add_logger_name branch April 30, 2024 16:31
@adamltyson
Copy link
Member

New version is released (0.4.1).

@JoeZiminski
Copy link
Member Author

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants